package com.tianzhu.repositories;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.tianzhu.domain.Cartitem;

public interface CartitemRepo extends JpaRepository<Cartitem, Long> {

	@Query(value="select * from CARTITEM where PRODUCTID = :productId",nativeQuery=true)
	public Cartitem getCartItemByProductId(@Param("productId") Long productId);
	
	@Modifying
	@Query(value="delete from CARTITEM where CARTITEMID = :productId",nativeQuery=true)
	public void delete(@Param("productId") Long productId);
	
}
